import axios from '@/libs/request/axios'
let prefix = "/jobadmin"


export const getJobPageList = (params)=> {
  return axios.request({
    url: prefix + '/jobinfo/pageList',
    method: 'get',
    params: params
  })
}

export const getJobsByGroup = (groupId)=> {
  return axios.request({
    url: prefix + '/jobinfo/getJobsByGroup',
    method: 'post',
    params: {jobGroup: groupId}
  })
}

export const create = (params) =>{
  return axios.request({
    url: prefix + '/jobinfo/add',
    method: 'post',
    data: params
  })
}

export const remove = (id) =>{
  return axios.request({
    url: prefix + '/jobinfo/remove',
    method: 'get',
    params: {id: id}
  })
}

export const update = (params)=> {
  return axios.request({
    url: prefix + '/jobinfo/update',
    method: 'post',
    data: params
  })
}

export const jobTrigger = (params) =>{
  return axios.request({
    url: prefix + '/jobinfo/trigger',
    method: 'get',
    params: params
  })
}

export const start = (id) =>{
  return axios.request({
    url: prefix + '/jobinfo/start',
    method: 'get',
    params: {id: id}
  })
}

export const stop = (id)=> {
  return axios.request({
    url: prefix + '/jobinfo/stop',
    method: 'get',
    params: {id: id}
  })
}
